package com.xiaozhichao.javaapi.designpattern.factory.general;

import com.xiaozhichao.javaapi.designpattern.factory.MailSender;
import com.xiaozhichao.javaapi.designpattern.factory.Sender;
import com.xiaozhichao.javaapi.designpattern.factory.SmsSender;

/**
 * 普通工厂类
 */
public class GeneralFactory {

    public Sender produce(String type){
        if("sms".equals(type)){
            return new SmsSender();
        }else if("mail".equals(type)){
            return new MailSender();
        }
        return null;
    }

}
